<template>
	<a-form @submit="handleSubmit" :form="form" class="form" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
		<a-row class="form-row">
			<a-col :xl="{span: 6}">
				<a-form-item label="公司/机构名称">
					<p>张三</p>
					<a-input v-model="form.mechanism" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="公司/机构地址">
					<p>020-89814314</p>
					<a-input v-model="form.address" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="法人姓名">
					<p>线下</p>
					<a-input v-model="form.faname" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="法人身份证号">
					<p>企业</p>
					<a-input v-model="form.idcard" />
				</a-form-item>
			</a-col>
		</a-row>
		<a-row class="form-row">
			<a-col :xl="{span: 6}">
				<a-form-item label="法人身份证正面照">
					<p>张三</p>
					<a-input v-model="form.faidcard" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="法人身份证背面照">
					<p>020-89814314</p>
					<a-input v-model="form.faidcard_back" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="工商执照">
					<p>线下</p>
					<a-input v-model="form.companyid" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="入驻时间">
					<p>020-89814314</p>
					<a-input v-model="form.create_time" />
				</a-form-item>
			</a-col>
		</a-row>
		<a-row class="form-row">
			<a-col :xl="{span: 6}">
				<a-form-item label="推广区域">
					<p>全国</p>
					<a-input v-model="form.shopcity" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="支付宝账号">
					<p>张三</p>
					<a-input v-model="form.alipayaccount" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="邮箱地址">
					<p>020-89814314</p>
					<a-input v-model="form.email" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="失效日期">
					<p>020-89814314</p>
					<a-input v-model="form.end_time" />
				</a-form-item>
			</a-col>
		</a-row>
		<a-row class="form-row">
			<a-col :xl="{span: 6}">
				<a-form-item label="账户余额">
					<p>线下</p>
					<a-input v-model="form.balance" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="账户冻结金额">
					<p>企业</p>
					<a-input v-model="form.balance_end" />
				</a-form-item>
			</a-col>
			<a-col :xl="{span: 6}">
				<a-form-item label="备注">
					<p>企业</p>
					<a-input v-model="form.remark" />
				</a-form-item>
			</a-col>
		</a-row>
		<a-form-item v-if="showSubmit">
			<a-button htmlType="submit">Submit</a-button>
		</a-form-item>
	</a-form>
</template>

<script>
	export default {
		name: 'TaskForm',
		props: ['showSubmit'],
		i18n: require('./i18n-task'),
		data() {
			return {
				form: this.$form.createForm(this)
			}
		},
		methods: {
			handleSubmit(e) {
				e.preventDefault()
				this.form.validateFields((err, values) => {
					if (!err) {
						console.log('Received values of form: ', values)
					}
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.form {
		.form-row {
			margin: 0 -8px
		}

		.ant-col-md-12,
		.ant-col-sm-24,
		.ant-col-lg-6,
		.ant-col-lg-8,
		.ant-col-lg-10,
		.ant-col-xl-8,
		.ant-col-xl-6 {
			padding: 0 8px
		}
	}
</style>
